import {createApp} from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import ElementPlus from 'element-plus' //引入element-plus库
import 'element-plus/dist/index.css' //引入element-plus样式
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
// import VForm3 from 'vform3-builds'  //引入VForm3库
// import 'vform3-builds/dist/designer.style.css'  //引入VForm3样式


import "./assets/css/base.css" // 设置全局基本样式

import axios from 'axios' // 引入axios用于前后端通信
import mitt from 'mitt' // 引入mitt库，因为Vue3移除了事件总线，因此借助第三方库
import {request} from "./network/request"; // 引入axios封装函数request
import qs from 'qs' 

const app = createApp(App);
app.config.globalProperties.$axios = axios; // 配置axios成为vue的全局变量
app.config.globalProperties.$bus = mitt(); // 配置eventbus成为vue的全局变量
app.config.globalProperties.$request = request; // 配置request成为vue的全局变量
app.config.globalProperties.$qs=qs;

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(ElementPlus, {
  locale: zhCn,
}).use(store).use(router).mount('#app')
